package top.scauwlt.loadbalance.loadbalancer;

import top.scauwlt.loadbalance.AbstractLoadBalance;
import top.scauwlt.remoting.dto.RpcRequest;

import java.util.List;
import java.util.Random;

/**
 * @Author wmm
 * @Date 2022/7/24 17:19
 */
public class RandomLoadBalance extends AbstractLoadBalance {
    @Override
    public String doSelect(List<String> serviceUrlList, RpcRequest rpcRequest) {
        return serviceUrlList.get(new Random().nextInt(serviceUrlList.size()));
    }
}
